using GameLogic.AbilitySystem.Ability;
using GameLogic.AbilitySystem.Attribute;
using GameLogic.AbilitySystem.Effect;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;


namespace GameLogic.AbilitySystem
{
    /// <summary>
    /// 能力组件
    /// 包含三个部分：基础数值集、Buff容器以及持有能力（技能）
    /// </summary>
    public class AbilitySystemComponent : MonoBehaviour
    {
        /// <summary>
        /// 基础数值集
        /// </summary>
        public CharacterAttributeSet AttributeSet = new();

        /// <summary>
        /// 持有的技能
        /// </summary>
        public AbilityComponent abilityComponent = new();

        /// <summary>
        /// 定间隔刷新
        /// </summary>
        public void FixedUpdate()
        {
            AttributeSet.EffectContainer.Update(Time.fixedDeltaTime);
        }

        /// <summary>
        /// 获得技能
        /// </summary>
        /// <param name="ability"></param>
        public void GrantAbility(AbilityBase ability)
        {
            abilityComponent.GrantAbility(ability);
        }

        public void ActivateAbilityWithTag(string tag)
        {
            abilityComponent.ActivateAbilityWithTag(tag);
        }

    }
}
